We are currently in the process of migrating an application from R5 to R6.
In R5 to overcome the limitation of the domino jvm we were using an external jvm to generate our SSL SOAP calls.
Now, in R6 we should be able to do everything within domino. Unfortunately, we are facing a constant error :
[SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket: null; targetException=java.lang.IllegalArgumentException: Error opening socket: null]
23.10.2003 11:21:25 AMgr: Agent ('wGetInfoClientTestLocal2' in 'credwf\app.nsf') error message: at org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnection.java:333)
23.10.2003 11:21:25 AMgr: Agent ('wGetInfoClientTestLocal2' in 'credwf\app.nsf') error message: at org.apache.soap.rpc.Call.invoke(Call.java:217)
23.10.2003 11:21:25 AMgr: Agent ('wGetInfoClientTestLocal2' in 'credwf\app.nsf') error message: at ThirdPartyServiceProxy.getThirdParty(ThirdPartyServiceProxy.java:164)
23.10.2003 11:21:25 AMgr: Agent ('wGetInfoClientTestLocal2' in 'credwf\app.nsf') error message: at JavaAgent.NotesMain(JavaAgent.java:12)
23.10.2003 11:21:25 AMgr: Agent ('wGetInfoClientTestLocal2' in 'credwf\app.nsf') error message: at lotus.domino.AgentBase.runNotes(Unknown Source)
23.10.2003 11:21:25 AMgr: Agent ('wGetInfoClientTestLocal2' in 'credwf\app.nsf') error message: at lotus.domino.NotesThread.run(NotesThread.java:208)
After debbugging, it seems the SSL context is not loaded, therefore the further use of the SSL classes is disabled. If anyone has a suggestion or a workaround, we would be glad to hear it.
Note: The same java classes execute successfully under WSAD 5.0x.
Best regards,
Marie Millet
Unicible
The java classes :
----------------
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Vector;
import org.apache.soap.Constants;
import org.apache.soap.Fault;
import org.apache.soap.SOAPException;
import org.apache.soap.encoding.SOAPMappingRegistry;
import org.apache.soap.rpc.Call;
import org.apache.soap.rpc.Parameter;
import org.apache.soap.rpc.Response;
import org.apache.soap.transport.http.SOAPHTTPConnection;
public class ThirdPartyServiceProxy
{
private Call call = new Call();
private URL url = null;
private String stringURL = "
https://www.myserverws.com/myservice";
private SOAPMappingRegistry smr = call.getSOAPMappingRegistry();
private SOAPHTTPConnection hc = new SOAPHTTPConnection();
public ThirdPartyServiceProxy() {
}
public synchronized void setEndPoint(URL url)
{
this.url = url;
}
public synchronized URL getEndPoint() throws MalformedURLException
{
return getURL();
}
private URL getURL() throws MalformedURLException
{
if (url == null && stringURL != null && stringURL.length() > 0)
{
url = new URL(stringURL);
}
return url;
}
public synchronized java.lang.String getThirdParty(java.lang.String userId,long identifier) throws Exception
{
java.lang.System.setProperty( "javax.net.debug","ssl");
java.lang.System.setProperty( "javax.net.ssl.trustStore","c:\\mykeys\\key01.jks");
java.lang.System.setProperty( "java.protocol.handler.pkgs","com.ibm.net.ssl.internal.www.protocol");
String targetObjectURI = "
http://tempuri.org/web.services.myservice";
String SOAPActionURI = "";
if(getURL() == null)
{
throw new SOAPException(Constants.FAULT_CODE_CLIENT,
"A URL must be specified via ThirdPartyServiceProxy.setEndPoint(URL).");
}
hc.setUserName("user01");
hc.setPassword("password01");
call.setSOAPTransport(hc);
call.setMethodName("getThirdParty");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
call.setTargetObjectURI(targetObjectURI);
Vector params = new Vector();
Parameter userIdParam = new Parameter("userId", java.lang.String.class, userId, Constants.NS_URI_SOAP_ENC);
params.addElement(userIdParam);
Parameter identifierParam = new Parameter("identifier", long.class, new Long(identifier), Constants.NS_URI_SOAP_ENC);
params.addElement(identifierParam);
call.setParams(params);
Response resp = call.invoke(getURL(), SOAPActionURI);
if (resp.generatedFault())
{
Fault fault = resp.getFault();
call.setFullTargetObjectURI(targetObjectURI);
throw new SOAPException(fault.getFaultCode(), fault.getFaultString());
}
else
{
Parameter refValue = resp.getReturnValue();
return ((java.lang.String)refValue.getValue());
}
}
}
the java.security file :
----------------------
[...]
security.provider.1=sun.security.provider.Sun
security.provider.2=com.sun.net.ssl.internal.ssl.Provider
security.provider.3=com.ibm.jsse.JSSEProvider
security.provider.4=com.ibm.crypto.provider.IBMJCA
[...]
the java.policy file :
--------------------
added following lines in the grant section
permission java.util.PropertyPermission "java.protocol.handler.pkgs", "write";
permission java.util.PropertyPermission "javax.net.ssl.trustStore", "write";
permission java.util.PropertyPermission "javax.net.debug", "write";